<%--
  Created by IntelliJ IDEA.
  User: 门铎
  Date: 2016/6/24
  Time: 10:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<nav class="navbar-default navbar-side" role="navigation">
    <div class="sidebar-collapse">
        <ul class="nav" id="main-menu">
            <%--<li>
                <div class="user-img-div">
                    <img src="${pageContext.request.contextPath}/img/user.png" class="img-thumbnail"/>

                    <div class="inner-text">
                        ${username}
                        <br/>
                    </div>
                </div>

            </li>
            --%>
            <c:choose>
                <c:when test="${roleId==2}">
                    <li>
                        <a  <%--class="active-menu"--%>  href="${pageContext.request.contextPath}/cimv/user/details/${userId}"><i class="fa fa-toggle-on"></i>我的主页</a>
                    </li>
                </c:when>
                <c:otherwise>
                    <c:forEach var="key" begin="1" end="10" step="1">
                        <c:choose>
                            <c:when test="${fn:length(mapList[key])==1}">
                                <li>
                                    <a href="${pageContext.request.contextPath}/cimv/${mapList[key][0].menuUrl}"><i class="fa fa-desktop "></i>${mapList[key][0].menu}<span class="fa arrow"></span></a>
                                </li>
                            </c:when>
                            <c:otherwise>
                                <li>
                                    <a href="#"><i class="fa fa-desktop "></i>${mapList[key][0].menu}<span class="fa arrow"></span></a>

                                    <ul class="nav nav-second-level">
                                        <c:forEach var="list" items="${mapList[key]}">
                                            <li>
                                                <a  <%--class="active-menu"--%>  href="${pageContext.request.contextPath}/cimv/${list.menuUrl}"><i class="fa fa-toggle-on"></i>${list.menuName}</a>
                                            </li>
                                        </c:forEach>
                                    </ul>
                                </li>
                            </c:otherwise>
                        </c:choose>
                    </c:forEach>
                </c:otherwise>
            </c:choose>

        </ul>
    </div>

</nav>
</body>
</html>
